package com.codefish.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.codefish.dto.MenuTreeDto;
import com.codefish.entity.SysBaseCommonEntity;
import com.codefish.entity.SysPermissionEntity;
import com.codefish.entity.SysPermissionMenuEntity;

import java.util.List;
import java.util.Map;

/**
 * 权限
 *
 * @author codefish
 * @email cool_fish@aliyun.com
 * @date 2021-04-15 17:58:46
 */
public interface SysPermissionService extends IService<SysPermissionEntity> {

    /**
     * 新增 Permission
     * @param userId permission
     * @return
     */
    int savePermission(Long userId, SysPermissionEntity permission);

    /**
     * 查询权限数量
     * @param permission
     * @return
     */
    int selectCount(SysPermissionEntity permission);

    /**
     * 修改权限
     * @param userId
     * @param permission
     * @return
     */
    int updatePermission(Long userId, SysPermissionEntity permission);

    /**
     * 获取菜单
     * @param userId
     * @return
     */
    List<MenuTreeDto> getMenuTree(Long userId,Map<String,Object> params);

    /**
     * 删除单个
     * @param id
     * @return
     */
    boolean deleteOne(String id);


    /**
     * 根据上级菜单获取下级菜单列表
     * @param baseCommonKey
     * @return
     */
    List<SysPermissionEntity> getListByMenuType(String baseCommonKey);
}

